Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.3.0 remove a layer of indirection (unnecessary passthrough) #49

Merged
merged 22 commits into from
Oct 24, 2024

Conversation

jackyzha0
Copy link
Member

@jackyzha0 jackyzha0 commented Oct 24, 2024

we shouldnt use passthrough if we dont need it, we got wrecked by the default watermark on the passthrough stream

@jackyzha0 jackyzha0 changed the title add test first remove a layer of indirection and use tty:Readstream and tty:Writestream directly Oct 24, 2024
@jackyzha0 jackyzha0 marked this pull request as ready for review October 24, 2024 18:39
wrapper.ts Outdated Show resolved Hide resolved
@jackyzha0 jackyzha0 changed the title remove a layer of indirection and use tty:Readstream and tty:Writestream directly remove a layer of indirection (unnecessary passthrough) Oct 24, 2024
@jackyzha0 jackyzha0 changed the title remove a layer of indirection (unnecessary passthrough) 3.3.0 remove a layer of indirection (unnecessary passthrough) Oct 24, 2024
@jackyzha0 jackyzha0 merged commit b6f230b into main Oct 24, 2024
4 checks passed
@jackyzha0 jackyzha0 deleted the jackyzha0/remove-indirection branch October 24, 2024 20:39
Comment on lines +83 to +85
this.write = new Writable({
write: this.#socket.write.bind(this.#socket),
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks disgusting. i love it.


read: Readable;
write: Writable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also have this be a getter for symmetry?

userFacingWrite.pipe(this.#socket);
this.read = userFacingRead;
this.write = userFacingWrite;
this.#socket = new ReadStream(this.#fd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.#socket = new ReadStream(this.#fd)
this.#socket = new ReadStream(this.#fd);

ewwww semicolonless code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants